package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
/*
* 根据我们的菜品id来查询对应的套餐id*/
    List<Long> getSetmealIdByDishIds(List<Long> dishIds);

    /*
    * 批量保存套餐和菜品的关联关系*/
    void insertBatch(List<SetmealDish> setmealDishes);

    @Delete("delete from setmeal_dish where setmeal_id = #{setmealid}")
    void deletyBySetmealId(Long setmealid);

    /*
    * 根据套餐id查询和菜品的关联信息*/
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getBySetmealId(Long id);

    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);

}
